<div class="topurl">
        	<span class="left">
            	Bạn đang xem: <a href="<?php echo base_url();?>"><b>Trang chủ</b></a>  &raquo; <a href="<?php echo base_url().'tu-van-hoi-dap';?>" class="current">Tư vấn - Hỏi đáp</a>
            </span>
            <span class="right">
            	<span>Hỗ trợ bán hàng:</span> 
            	<?php if(isset($support) && $support != null) {?>
                <?php foreach($support as $k => $v) {?> 
            		<a href="ymsgr:sendim?<?php echo $v->yahoo;?>" title="<?php echo $v->yahoo;?>">	                            	
                    	<img src="http://opi.yahoo.com/online?u=<?php echo $v->yahoo;?>&t=1" title="Chat với <?php echo $v->yahoo;?>" alt="Chat với <?php echo $v->yahoo;?>" />
                    </a> 
            	<?php }?>
            	<?php }?>
                <img src="<?php echo img_link('i-phone.gif');?>" title="" alt="" /> <span><b>043 824 3536</b> | <b>0979 899 100</b></span>
            </span>
        </div>
        <div class="main">
        	<div id="sidebar">
            	<h2 class="help"><a href="<?php echo base_url().'huong-dan-mua-hang.html';?>">Hướng dẫn mua hàng</a></h2>
                <?php if(isset($questions_usually) && $questions_usually !=null) {?>
                <div class="b-left-sp">                	
                	<span class="title">Câu hỏi thường gặp</span>
                    <ul class="sp-l">                                        
                    <?php foreach($questions_usually as $k => $v){?>
                    	<li><a href="<?php echo base_url().'tu-van-hoi-dap/detail/'.$v->id.'/'.$v->title_link.'.html';?>" title="<?php echo $v->title;?>"><?php echo $v->title;?></a></li>
                    <?php }?>                    
                    </ul>                    
                </div>
                <?php }?>
                <div class="b-sidebar">
                	<div class="titile-news">Sản phẩm bán chạy trong tháng</div>
                    <ul class="list-sp">
                    	<?php if(isset($products_best_sales) && $products_best_sales != null) {?>
                    	<?php foreach($products_best_sales as $k => $v) {?>
                    	<li>
                    		<?php $img_path = $this->home_model->get_images_products_by_product_id($v->id);?>
                    		<?php if($img_path != null){?>
                    		<a href="<?php echo base_url().'gian-hang/detail/'.$v->id.'/'.$v->name_link.'.html';?>" title="<?php echo $v->name;?>">
                        		<img src="<?php echo show_thumb($img_path[0]->img_path,'65-34');?>" title="<?php echo $v->name;?>" alt="<?php echo $v->name;?>" class="thumb" />
                        	</a>
                        	<?php }?>
                            <span class="info"><a href="<?php echo base_url().'gian-hang/detail/'.$v->id.'/'.$v->name_link.'.html';?>"><?php echo $v->name;?></a><br /> <b><?php echo format_type_money($v->price);?> VND</b></span>
                        </li>
                        <?php }?>
                        <?php }?>
                    </ul>
                </div>
                <div class="btn-download"><a href="#"><img src="<?php echo img_link('i-download.gif');?>" alt="" title="" /></a></div>
            </div>
            <div class="b-qa">
                <div class="b-qa-top">
                	<?php
		        		$attributes = array(
		        			"method"	=>	'get',
		        			"onsubmit"	=>	'search_questions(); return false;'
		        		);
		        		echo form_open("",$attributes);
		        	?>
                	<?php
			      	  $in_search = array(
			      	  	'name'	=>	'keyword',
			      	  	'id'	=>	'keyword',
			      	  	'class'	=>	'text',
			      	  	'value'	=> 	(isset($keyword) ? entities_to_ascii($keyword): '')
			      	  );
			      	?>   
                	<input type="text" name="keyword" id="keyword" value="<?php echo (isset($keyword) ? entities_to_ascii($keyword): '');?>" class="text" />                    	
                    <input type="submit" name="submit" value="Tìm kiếm câu hỏi" class="btns" style="width:125px;"/>
		      	  	<?php echo form_close();?>
                    
                    <a href="<?php echo base_url().'tu-van-hoi-dap/dat-cau-hoi';?>">
                    	<input type="button" name="" value="Đặt câu hỏi" class="btns" style="width:94px;" />
                    </a>
                </div>
                <div class="b-quest">                
                	<h1><?php echo $questions_info[0]->title;?></h1>
                    <p><?php echo $questions_info[0]->contents;?></p>
                    <span class="source">Hỏi bởi: <?php echo $questions_info[0]->fullname;?>, ngày <?php echo date('d-m-Y', strtotime($v->date_create));?></span>
                </div>
                
                <?php $answer = $this->questions_model->get_answer_by_id_questions($questions_info[0]->id);?>
                <?php if(isset($answer) && $answer != null){?>
                <span class="titleans"><font style="color:#ed1b24; font-weight:bold; font-size:18px;">Trả lời</font> ngày <?php echo date('d-m-Y', strtotime($answer[0]->date_answer));?></span>
				<div class="content-ans">                	
                		<?php echo $answer[0]->contents;?>                	
                </div>
                <?php }?>
                <div class="form-ques">
                	<h2>Bạn có những băn khoăn, thắc mắc về điều hòa? Hãy gửi câu hỏi cho chúng tôi.</h2>
                    <ul class="lineform">
                    	<?php
		                  $fullname = array(
		                    'name'    =>  'txtName',
		                    'style'   =>  'width:96%;',
		                    'value'   =>  set_value('txtName')
		                  );		                  
		                  $email = array(
		                    'name'    =>  'txtEmail',
		                    'style'   =>  'width:96%;',
		                    'value'   =>  set_value('txtEmail')
		                  );
		                  $phone = array(
		                    'name'    =>  'txtPhone',
		                    'style'   =>  'width:96%;',
		                    'value'   =>  set_value('txtPhone')
		                  );    
		                  $title = array(
		                    'name'    =>  'txtTitle',
		                    'style'   =>  'width:96%;',
		                    'value'   =>  set_value('txtTitle')
		                  );         
		                  $content = array(
		                    'name'    =>  'txtContent',
		                    'rows'    =>  '5',
		                    'cols'    =>  '30',
		                    'style'   =>   'width:96%'
		                  );
		                  
		                  $i=0;
		                  if($this->message->get("success")){
		                    echo $this->message->display("success");
		                  }
		                  if($this->message->get('error')){
		                  	echo $this->message->display("error");
		                  }    
		                                   
		                  if(form_error($fullname['name']))
                          {       	                        		
                        	$fullname['style'] = 'border:solid 1px #ff0000; width:96%;';                        	
                  		  }
                  		  if(form_error($email['name']))
                          {       	                        		
                        	$email['style'] = 'border:solid 1px #ff0000; width:96%;';                        	
                  		  }
                  		  if(form_error($phone['name']))
                          {       	                        		
                        	$phone['style'] = 'border:solid 1px #ff0000; width:96%;';                        	
                  		  }
                  		  if(form_error($title['name']))
                          {       	                        		
                        	$title['style'] = 'border:solid 1px #ff0000; width:96%;';                        	
                  		  }
                  		  if(form_error($content['name']))
                          {       	                        		
                        	$content['style'] = 'border:solid 1px #ff0000; width:96%;';                        	
                  		  } 
                  		  
                  		  if(form_error($fullname['name']) || form_error($email['name']) || form_error($phone['name']) || form_error($title['name']) || form_error($content['name']))
                  		  {
                  		  	echo "<li class='error'><p>Có lỗi xảy ra! hãy kiểm tra lại các trường thông tin!</p></li>";
                  		  }
	                	?>
	                	<?php echo form_open(base_url()."tu-van-hoi-dap/dat-cau-hoi");?>
                    	<li>
                        	<span class="item">Họ tên<br />
                        		<?php echo form_input($fullname);?>
                        	</span>
                            <span class="item">Email<br />
                            	<?php echo form_input($email);?>
                            </span>
                            <span class="item">Số điện thoại<br />
                            	<?php echo form_input($phone);?>
                            </span>
                        </li>
                        <li>
                        	Tiêu đề<br />
                        	<?php echo form_input($title);?>
                        </li>
                        <li>
                        	Nội dung<br />
                        	<?php echo form_textarea($content,set_value($content['name']));?>
                        </li>
                        <li>
                        		Mã xác nhận:<br />
                                <img src="<?php echo base_url();?>client/questions/captcha/<?php echo rand();?>"/><br />                                
                                <br />                                              
                                Gõ lại chính xác các chữ cái trên:<br />
                                <input type="text" name="val" value="" class="maxacnhan" style="width:30%;" />
                                <?php 
		                        	if(isset($error) && $error != "")
		                        	{                    
		                    			echo "<li class='error'>"."Mã xác nhận không hợp lệ"."</li>";
		                  			}
                  				?>
                        	<input type="submit" name="submit" value="Gửi câu hỏi" class="btnsend" />
                        </li>
                        <?php echo form_close();?>
                    </ul>
                </div>
            </div>
        </div>